package com.wl.designpattern.command;

/**
 * 创建具体命令角色
 * Created by wangliang on 2021/2/27.
 */
public class ShutdownCommand implements Command {
    private Receiver receiver;//接受者

    public ShutdownCommand(Receiver receiver) {
        this.receiver = receiver;
    }

    @Override
    public void execute() {
        System.out.println("命令角色执行关机命令");
        receiver.action();//调用接受者
    }
}
